#include <iostream>

using namespace std;

int main()
{
    int act, left, eat = 0;
    cin >> act >> left;
    long long Max = 0;

    for (int put = act; put >= 0; --put)
    {
        eat = act - put;
        if (put % 2 == 0) Max = put/2 * (put+1);
        else Max = (put+1)/2 * put;
        if (Max - eat == left) break;
    }
    cout << eat;
    return 0;
}
